home *** CD-ROM | disk | FTP | other *** search
/ Practical Algorithms for Image Analysis / Practical Algorithms for Image Analysis.iso / LIBIMAGE / IMAGES.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-11  |  2.2 KB  |  106 lines

  1. /* 
  2.  * images.h
  3.  * 
  4.  * Practical Algorithms for Image Analysis
  5.  * 
  6.  * Copyright (c) 1999 SOS Software
  7.  */
  8.  
  9. /* IMAGES.H:    include file contains informataion for image display on sun
  10.  *
  11.  */
  12.  
  13. #ifndef IMAGESH                 /* prevents multiple images.h defn */
  14. #define IMAGESH 1
  15.  
  16. /* image size */
  17. #define    XSIZE        512              /* sun monitor actually goes to 640 */
  18. #define    YSIZE        512              /* and y size only goes to 480 */
  19.  
  20. #define XSIZEBIG 1024           /* bigger image than standard 512 */
  21. #define YSIZEBIG 1024
  22.  
  23. /*  Color mapping table for pseudo color on sun */
  24.  
  25. #define RED 249
  26. #define GREEN 250
  27. #define BLUE 251
  28. #define CYAN 252
  29. #define MAGENTA 253
  30. #define YELLOW 254
  31. #define OVERLAY 248
  32. #define CURSOR 247
  33. #define BACKCOLOR 246
  34. #define HIVALUE 246
  35. #define LOWVALUE 0
  36. #define HIBINARY 255
  37.  
  38. #define IMGOFF 0
  39. #define IMGON 255
  40.  
  41. #ifdef max
  42. #undef min
  43. #undef max
  44. #endif
  45. int cg1dd ();
  46.  
  47. /* image file header */
  48.  
  49. struct pheader {                /* header in front of each binary image file */
  50.   char magic;                   /* 8 bit magic number PICMAGIC */
  51.   char type;                    /* compressed, expanded, or black and white */
  52.   char psize;                   /* number of bytes per pixel */
  53.   char spare1;
  54.   int transparent;              /* transparent color */
  55.   int xsize;                    /* pixels per line */
  56.   int ysize;                    /* lines in image */
  57.   int spare2;
  58. };
  59.  
  60. /* defines for use on all machines */
  61.  
  62. #define    PICMAGIC    'P'            /* magic numbers for image files */
  63. #define    PICIMAGES    'M'
  64.  
  65. #define    PICTYPE        char           /* types for PICMAGIC type files */
  66. #define    PICNORMAL    'e'
  67. #define    PICCOMPRESSED    'c'
  68. #define    PICBW        'b'
  69. #define    PICRUNLENGTH    'r'
  70.  
  71. struct point {
  72.   int x;                        /* x address */
  73.   int y;                        /* y address */
  74. };
  75.  
  76. struct line {
  77.   struct point begin;
  78.   struct point end;
  79. };
  80.  
  81. struct rectangle {
  82.   struct point min;
  83.   struct point max;
  84. };
  85.  
  86.      /* from Sun */
  87. struct raster {
  88.   int wd, ht, dp;
  89.   unsigned char *bits;
  90. };
  91. struct bwraster {
  92.   int wd, ht, dp;
  93.   short *bits;
  94. };
  95.  
  96. struct dpoint {
  97.   double x, y;                  /* x,y coordinate */
  98. };
  99.  
  100. struct dsegment {
  101.   struct dpoint pt1;
  102.   struct dpoint pt2;
  103. };
  104.  
  105. #endif
  106.